/*
 * @Author: zwz
 * @Date: 2023-09-10 17:35:55
 * @LastEditors: zwz
 * @LastEditTime: 2023-09-10 21:29:16
 * @Description: 请填写简介
 */
import request from '@/utils/request'

// 新增
export function addOrder(data) {
  return request({
    url: '/order/normal/add',
    method: 'post',
    data: data
  })
}

export function list(query) {
  return request({
    url: '/order/normal/list',
    method: 'get',
    params: query
  })
}

export function listAll(query) {
  return request({
    url: '/order/normal/listAll',
    method: 'get',
    params: query
  })
}

export function del(id) {
  return request({
    url: '/order/normal/' + id,
    method: 'delete'
  })
}

export function get(id) {
  return request({
    url: '/order/normal/' + id,
    method: 'get'
  })
}

export function update(data) {
  return request({
    url: '/order/normal',
    method: 'put',
    data: data
  })
}

//  明细
export function detailList(query) {
  return request({
    url: '/order/normal/detail/list',
    method: 'get',
    params: query
  })
}

export function addDetailOrder(data) {
  return request({
    url: '/order/normal/detail/add',
    method: 'post',
    data: data
  })
}

export function listNormalAll(query) {
  return request({
    url: '/order/normal/detail/listNormalAll',
    method: 'get',
    params: query
  })
}

export function detailDel(id) {
  return request({
    url: '/order/normal/detail/' + id,
    method: 'delete'
  })
}

export function getDetail(id) {
  return request({
    url: '/order/normal/detail/' + id,
    method: 'get'
  })
}

export function updateDetail(data) {
  return request({
    url: '/order/normal/detail',
    method: 'put',
    data: data
  })
}

export function orderCancel(data) {
  return request({
    url: `/order/normal/cancel/${data}`,
    method: 'get',
  })
}

export function orderRefund(id) {
  return request({
    url: `/order/normal/refund/${id} `,
    method: 'get',
  })
}


